-- GENERATED SPELL FOR [Twilight Overlord] --


function spell0_15213(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15213', 3000, 1)
end

function spell1_15213(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(13339,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15213', 657, 1)
end

function spell2_15213(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_15213', 8281, 1)
end

function spell3_15213(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15213', 7000, 1)
end

function Sorts_15213(pUnit, Event)
local choix_sorts_15213 = math.random(0, 3)
if choix_sorts_15213 == 0 then
pUnit:RegisterEvent('spell0_15213', 1, 1)
end
if choix_sorts_15213 == 1 then
pUnit:RegisterEvent('spell1_15213', 1, 1)
end
if choix_sorts_15213 == 2 then
pUnit:RegisterEvent('spell2_15213', 1, 1)
end
if choix_sorts_15213 == 3 then
pUnit:RegisterEvent('spell3_15213', 1, 1)
end
end

function mob15213_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15213', math.random(1500, 3000), 1)
end

function mob15213_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15213_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15213_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15213, 1, 'mob15213_Action')
RegisterUnitEvent(15213, 2, 'mob15213_Leave')
RegisterUnitEvent(15213, 3, 'mob15213_Kill')
RegisterUnitEvent(15213, 4, 'mob15213_Die')
